<template>
	<view class="vessel">
		<view class="comment_input">
			<input type="text" v-model="value" placeholder="说点什么吧"/>
		</view>
		<view class="issue" @tap="getContent">
			发布
		</view>
		<!-- 提示组件 -->
	<tui-tips ref="toast"  position="center"></tui-tips> 
	</view>
</template>

<script>
	export default {
		name:"commentTab",
		data() {
			return {
				value:''
			};
		},
		methods:{
			 getContent(){
				 const value = /^.{6,}$/
				 if(value.test(this.value)){
					 this.$emit('commentContent',this.value)
					 this.value='' 
				 }else{
					 const options = {
					 		msg: '评论内容至少于6个字符',
					 		duration: 2000
					 	};
						 this.$refs.toast.showTips(options); 
				 }
				 
			
			}
		}
	}
</script>

<style lang="less" scoped>
	.vessel{
		position: fixed;
		max-width: 100%;
		width: 100%;
		bottom: 0;
		height: 99rpx;
		display: flex;
		align-items: center;
		background-color: #fff;
		border-top: 1px solid #d8d8d8;
.comment_input{
	margin-left: 20rpx;
	width: 80%;
	height: 60rpx;
	background-color: #f2f2f2;
	border-radius: 80rpx;
	background-color:#f2f2f2;
	input{
		padding-left: 20rpx;
		height: 60rpx;
		border-radius: 80rpx;
	}
}
.issue{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20%;
	color:  #999;
}
}
</style>
